// Drummer
// by Andrea Bianchi
// andreabianchi.alsoplantsfly.com

/*
 Copyright (C) 2009, Andrea Bianchi
 
 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License
 as published by the Free Software Foundation; either version 2
 of the License, or (at your option) any later version.
 
 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
*/

#ifndef __STYLUS_EVENT_MANAGER__H__
#define __STYLUS_EVENT_MANAGER__H__

#include "global.h"

namespace DS
{

	typedef  void (*Event)();

	class StyulusEventManager 
	{
	public:
		static StyulusEventManager* getInstance();

		void registerOnStyulsPressed (Event callback);
		void registerOnStyulsReleased (Event callback);
		void registerOnStyulsDragged (Event callback);

		void handleEvents();
		inline bool isPressed(){ return pressed_; }

	private:

		StyulusEventManager() :press_(0), released_(0), dragged_(0), pressed_(false){}
		~StyulusEventManager(){}

		Event press_; 
		Event released_;
		Event dragged_;
		bool pressed_;
	};
}

#endif __STYLUS_EVENT_MANAGER__H__